package com.springcloud.alibaba.nacos.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @Author:RenPu
 * @Date: 2020/7/2 17:32
 * @Version: 1.0
 * @description:
 */

@RestController
@Slf4j
public class NacosConsumerController {

    @Resource
    private RestTemplate restTemplate;

    @Value("${server.port}")
    private String SERVER_PORT;

    @Value( "${service-url.nacos-user-service}" )
    private String SERVER_URL;

    @GetMapping("/nacos/consumer")
    public String nacosTestRibbon(){

       return restTemplate.getForObject( SERVER_URL +"/nacos/resgister/test", String.class );


    }



}
